package servlet;

import domain.HttpRequest;
import domain.HttpResponse;

import java.io.IOException;
import java.nio.channels.SelectableChannel;

public class ErrorServlet implements HttpServlet {
    @Override
    public void service(HttpRequest httpRequest, HttpResponse httpResponse) {
        try {
            httpResponse.response("当前没有该方法");
            SelectableChannel channel = httpResponse.getHttpRequest().getSelectionKey().channel();
            channel.close();
            System.out.println("执行结束...通道关闭...");
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
